package com.decoration.basic.contancts;

import com.decoration.basic.interceptor.ApiInterceptor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.io.FileInputStream;
import java.io.IOException;
import java.util.Properties;

public class ComContanct {
    private static final Logger log = LoggerFactory.getLogger(ComContanct.class);
    private static final String RESOURCE_PATH = Thread.currentThread().getContextClassLoader().getResource("").getPath()+"/i18n/i18n.properties";
    public static String PERMIT_THROUGH = "";
    public static String PICTURE_UPLOAD_DIR = "";
    public static String PICTURE_DOWNLOAD_URL = "";
    public static String PERMIT_URL = "";

    static {
        try(FileInputStream in = new FileInputStream(RESOURCE_PATH)) {
            Properties prop = new Properties();
            prop.load(in);
            PERMIT_THROUGH = prop.getProperty("PERMIT_THROUGH");
            PICTURE_UPLOAD_DIR = prop.getProperty("PICTURE_UPLOAD_DIR");
            PICTURE_DOWNLOAD_URL = prop.getProperty("PICTURE_DOWNLOAD_URL");
            PERMIT_URL = prop.getProperty("PERMIT_URL");
        } catch (IOException e) {
            log.error("读取配置文件异常",e );
        }
    }

}
